home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_asm / astrsys / yn.asm < prev   
Encoding:
Assembly Source File  |  1989-06-23  |  1.6 KB  |  39 lines

  1.                         PAGE    ,132
  2.                         Title   Yes/No Response Batch SubProcess
  3.  
  4. Cseg    Segment para public     'CODE'
  5.     Assume Cs:Cseg,Ds:Cseg,Es:Cseg,Ss:Cseg
  6.     org    100h
  7.  
  8. MAIN    proc    near            ; This is the main procedure
  9.         Mov     Ah,1            ; inputs char
  10.         Int     21h             ; Call DOS to do it
  11.         Push    Ax              ; Save the hell
  12.         Mov     Ah,2            ; Carriage Return
  13.         Mov     Dl,0Dh          ;
  14.         Int     21h             ;
  15.         Mov     Ah,2            ; Line Feed!
  16.         Mov     Dl,0Ah          ;
  17.         Int     21h             ;
  18.         Pop     Ax              ; Get back
  19.         Cmp     Al,'Y'          ; Is it a CAP Y?
  20.         Je      IsYes           ; Yes, so go there
  21.         Cmp     Al,'y'          ; Is it a small y?
  22.         Je      IsYes           ; Yes, so go there
  23.         Cmp     Al,'N'          ; Is it a CAP N?
  24.         Je      IsNo            ; Yes the response was such
  25.         Cmp     Al,'n'          ; Is Small N?
  26.         Jne     Other           ; No so get out of here
  27. IsNo:   Mov     Al,1            ; No response invokes 1 return code
  28.         Jmp     Short   Final   ; Goto final step
  29. IsYes:  Mov     Al,2            ; Yes resonse invokes 2 return code
  30.         Jmp     Short   Final   ; Goto Final Step
  31. Other:  Mov     Al,255          ; Other resoponse invokes NO (ff) ret code
  32. Final:  Mov     Ah,04Ch         ; Terminate process subcode
  33.         Int     21h             ; And that be all!
  34. MAIN    endp
  35.  
  36. Cseg    Ends
  37.         End     MAIN
  38. 
  39.